package com.study.entity;

import lombok.Data;

import java.util.List;

/**
 * Created by guanxy on 2017/10/19.
 */
@Data
public class Page<T> {
    /**
     * 当前页数
     */
    private Integer page;

    /**
     * 每页显示条数
     */
    private Integer size;
    /**
     * 总页数
     */
    private Integer totalPage;
    /**
     * 总条数
     */
    private Integer total;
    /**
     * 记录
     */
    private List<T> rows;


    public Page(Integer page, Integer size, Integer total, List<T> rows) {
        this.page = page;
        this.size = size;
        this.total = total;
        this.rows = rows;
        if (total%size==0){
            this.totalPage=total/size;
        }else{
            this.totalPage=total/size+1;
        }
    }

    public Page() {

    }
}
